#!/bin/bash
#===========================================================
#配置DSUB资源
#===========================================================
#DSUB --job_type cosched:hmpi
#DSUB -n cp2k_test
#DSUB -A root.jcyz
#DSUB -q root.default
#DSUB -R cpu=128;mem=496000;gpu=0
#DSUB -N 2
#DSUB -o out2_%J.log
#DSUB -e err2_%J.log

#===========================================================
#加载环境变量及依赖软件
#===========================================================
hr_path=/share/home/top_software/sunqian/hpcrunner-old
module purge
module use $hr_path/software/modulefiles

module load bisheng/2.1.0
module load hmpi/1.1.1
module load gsl/2.6

#===========================================================
#运行测试脚本
#===========================================================

echo "mpi hostfile generated:"
echo "-----------------------"
cat ${CCS_HOST_FILE}
echo "-----------------------"

cd $hr_path/cp2k-7.1.0/exe/Linux-arm-clang
EXEC_CMD="time -p mpirun --allow-run-as-root $CCS_MPI_OPTIONS -N 128  -x PATH -x LD_LIBRARY_PATH  -mca pml ucx -x UCX_NET_DEVICES=mlx5_0:1 -mca btl ^vader,tcp,openib,uct -x UCX_TLS=self,sm,rc --bind-to core --map-by socket --rank-by core -x OMP_NUM_THREADS=1 cp2k.psmp H2O-256.inp "

echo "$EXEC_CMD"
#$EXEC_CMD
time -p mpirun --allow-run-as-root $CCS_MPI_OPTIONS -N 128  -x PATH -x LD_LIBRARY_PATH  -mca pml ucx -x UCX_NET_DEVICES=mlx5_0:1 -mca btl ^vader,tcp,openib,uct -x UCX_TLS=self,sm,rc --bind-to core --map-by socket --rank-by core -x OMP_NUM_THREADS=1 cp2k.psmp $hr_path/cp2k-7.1.0/benchmarks/QS/H2O-256.inp

ret=$?
exit $ret
